<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>发送信息</title>
<style type="text/css">
	*{
		margin: 0px;
		padding: 0px;
	}
	#div_boss{
		width: 1920px;
		height: 1080px;
		background:url("/bbs/img/login_bg.png");
		position: absolute;
	}
	#head_div{
		width: 550px;
		height: 30px;
		font-size:23px;
		position: absolute;
		margin-top: 50px;
		margin-left: 1200px;
	}
	#head_div1{
		width:100px;
		height: 30px;
		text-align: center;
		position: absolute;
		margin-left: 0px;
		
	}
	#head_div2{
		width:200px;
		height: 30px;
		font-size:20px;
		text-align: center;
		position: absolute;
		margin-left: 100px;
	}
	#head_div3{
		width:100px;
		height: 30px;
		text-align: center;
		position: absolute;
		margin-left: 300px;
	}
	#head_div4{
		width:150px;
		height: 30px;
		text-align: center;
		position: absolute;
		margin-left: 400px;
	}
	.head_span:hover{
		cursor: pointer;
		font-size:25px;
		color: cornflowerblue;
	}
	#title{
		width: 200px;
		height:66px;
		font-family: Microsoft YaHei UI, Microsoft YaHei UI-Bold;
		font-weight: 600;
		font-size:50px;
		text-align:center;
		margin-top: 100px;
		margin-left: 860px;
		position: absolute;
	}
	#sendmsg_div{
		width:760px;
		height:600px;
		opacity: 0.9;
		background: #efeff0;
		border-radius: 5px;
		margin-top: 190px;
		margin-left: 580px;
	}
	#sendmsg_div1{
		height:30px;
		width:260px;
		font-size:23px;
		position: absolute;
		margin-left: 50px;
		margin-top: 20px;
	}
	#receivename_div1{
		width: 70px; 
		height:30px;
		position: absolute;
	}
	#receivename_div2{
		height:30px;
		width:150px;
		position: absolute;
		margin-left: 90px;
	}
	#receivename{
		height:26px;
		width:146px;
		font-size:21px;
		outline:none;
		position: absolute;
	}
	#sendmsg_div2{
		height:450px;
		width:600px;
		font-size:23px;
		position: absolute;
		margin-left: 50px;
		margin-top: 70px;
	}
	#note_div1{
		width: 70px; 
		height:30px;
		position: absolute;
	}
	#note_div2{
		height:450px;
		width:510px;
		margin-left: 90px;
	}
	#note{
		height:450px;
		width:510px;
		font-size:21px;
		resize: none;
		outline:none;
	}
	#sendmsg{
		width:50px;
		height: 30px;
		font-size:14px;
		color:#EEEEEE;
		background-color: cornflowerblue;
		cursor: pointer;
		border: none;
		outline:none;
		border-radius: 5px;
		margin-left: 370px;
		margin-top: 550px;
	}
	#sendmsg:hover{
		font-size:15px;
		color:white;
		background-color:#4E6EF2;
	}
	#sendsucc_div{
		width:150px;
		font-size:20px;
		text-align:center;
		color: red;
		position: absolute;
		margin-top: 524px;
		margin-left: 325px;
	}
</style>
<script type="text/javascript" src="/bbs/js/jquery-1.11.2.min.js"></script>
<script type="text/javascript">
	$(function(){
		//获取用户登录信息
		getUser();
	})
	function getUser(){
		$.post("getUser.json",{"opt":"selectUser"},function(data){
			$("span:eq(0)").html(data.uname);
		},"json");
	}
	function exit() {
		$.post("exit.json",{"opt":"exit"},function(data){
			location.href = "/bbs/index.html";
		},"text");
	}
	function listMsg() {
		location.href = "/bbs/login_succ/listMsg.html";
	}
	function send() {
		$.post("sendMsg.mess",$("form:eq(0)").serialize(),function(data){
			if(data==0){
				$("#sendsucc_div").empty();
				$("#sendsucc_div").html("该用户不存在！");
			}else if(data==-1){
				$("#sendsucc_div").empty();
				$("#sendsucc_div").html("信息内容为空！");
			}else{
				$("#sendsucc_div").empty();
				alert("短信发送成功！");
				location.href = "/bbs/login_succ/listMsg.html";
			}
		},"text")
	}
</script>
</head>
<body>
	<div id="div_boss">
		<div id="head_div">
			<div id="head_div1">当前用户</div>
			<div id="head_div2"><span></span></div>
			<div id="head_div3"><span class="head_span" onclick="exit()">[登出]</span></div>
			<div id="head_div4"><span class="head_span" onclick="listMsg()">[信息列表]</span></div>
		</div>
		<div id="title">发送信息</div>
		<form>
			<div id="sendmsg_div">
			<div id="sendmsg_div1">
				<div id="receivename_div1">接收者</div>
				<div id="receivename_div2"><input type="text" id="receivename" name="receiveUname"></div>
			</div>
			<div id="sendmsg_div2">
				<div id="note_div1">短信息</div>
				<div id="note_div2"><textarea name="note" id="note"></textarea></div>
			</div>
			<div id="sendsucc_div"></div>
			<input type="button" id="sendmsg" value="发送" onclick="send()">
			<input type="hidden" name="opt" value="sendMsg">
		</div>
		</form>
	</div>
</body>
</html>